package com.jsaas.core.security;

import java.io.Serializable;

import com.jfinal.plugin.activerecord.IBean;
import com.jsaas.model.User;

/**   
* @Title: UserPrincipal.java 
* @Package com.jsaas.core.security 
* @Description: TODO(用户身份) 
* @author tuozq 
* @date 2017年11月6日 上午9:52:55 
* @version V1.0   
*/
public class UserPrincipal implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private String userId;
	
	private String username;
	
	private String account;
	
	
	
	
	public String getUserId() {
		return userId;
	}



	public void setUserId(String userId) {
		this.userId = userId;
	}



	public String getUsername() {
		return username;
	}



	public void setUsername(String username) {
		this.username = username;
	}



	public String getAccount() {
		return account;
	}



	public void setAccount(String account) {
		this.account = account;
	}



	public UserPrincipal(User user){
		this.userId = user.getId();
		this.username = user.getName();
		this.account = user.getAccount();
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return this.getUsername() + " [ " + this.getAccount() + " ] ";
	}
}	
